home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / Apps / AuthMan 1.0.8 / AuthMan XCMD / authLibrary.h < prev    next >
Text File  |  1994-05-06  |  5KB  |  119 lines

  1. /*
  2.  * Copyright (c) 1992-1994 Regents of The University of Michigan.
  3.  * All Rights Reserved.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software and
  6.  * its documentation for any purpose and without fee is hereby granted,
  7.  * provided that the above copyright notice appears in all copies and
  8.  * that both that copyright notice and this permission notice appear
  9.  * in supporting documentation, and that the name of The University
  10.  * of Michigan not be used in advertising or publicity pertaining to
  11.  * distribution of the software without specific, written prior
  12.  * permission. This software is supplied as is without expressed or
  13.  * implied warranties of any kind.
  14.  *
  15.  *      Campus Computing Sites, Sales, and Service
  16.  *      The University of Michigan
  17.  *      c/o Robert John Churchill
  18.  *      535 W. William Street
  19.  *      Ann Arbor, Michigan
  20.  *      +1-313-936-2528
  21.  *      rjc@ccs.itd.umich.edu
  22.  */
  23.  
  24. #include <Types.h>
  25.  
  26. #pragma once
  27.  
  28.  
  29. #define    AUTHMAN_DRVR_NAME                "\p.AuthMan 1"                /* driver name */
  30. #define    AUTHMAN_VERSION_CODE            3                            /* current version */
  31.  
  32. #define    gestaltAuthManVersion            'UMAM'
  33.                                                 
  34. #define    AUTHENTICATE_NOW                128                            /* AuthMan v1 csCodes */
  35. #define    GET_AUTH_STATUS                    129
  36. #define    SHOW_MESSAGE                    130
  37. #define    GET_UNIQNAME                    131
  38. #define    FLUSH_TICKETS                    132
  39. #define    GET_AUTH_VERSION                133
  40. #define    RELOAD_INFO                        134
  41. #define    SET_UNIQNAME                    135
  42. #define    GET_LOCAL_REALM                    256
  43. #define    GET_V4_TICKET                    1024                        /* AuthMan v2 additional csCodes */
  44. #define    EXPIRE_V4_TICKET                1025
  45. #define    GET_V4_TICKET_N_INFO            1026
  46. #define    GET_REALM_N_INFO                1027
  47. #define    GET_REALM_HOST_N_INFO            1028
  48. #define    DES_FUNCTIONS                    1029
  49. #define    SET_V4_PASSWORD                    1050                        /* AuthMan v3 additional csCodes */
  50. #define    AUTH_MSG_CALLBACK                1051
  51.  
  52. typedef    struct    _V4ticketInfo    {
  53.     Str63            sName,sInstance,sRealm;                            /* service ticket info */
  54.     Str63            pName,pInstance,pRealm;                            /* principal of service ticket info */
  55.     long            issueDate,expireDate;                            /* in Macintosh time */
  56.     unsigned char    sessionKey[8];
  57.     } _V4ticketInfo,*_V4ticketInfoPtr;
  58.  
  59. #define    MAX_KTXT_LEN                    1250                        /* maximum Kerberos packet size (re: getV4Ticket) */
  60.  
  61. #define    INFINITE_LIFETIME                0xFFFFFFFF                    /* request an infinite lifetime */
  62.  
  63. #define    UNKNONW_REALM_TYPE                0                            /* Realm codes */
  64. #define    UNKNOWN_REALM_TYPE                0                            /* typo:  oops */
  65. #define    MIT_KERBEROS_REALM_TYPE            1
  66. #define    AFS_KERBEROS_REALM_TYPE            2
  67.                                                                     /* DES operation modifier*/
  68. #define    DES_DECRYPT                        0                                /* "or" with DES operations below */
  69. #define    DES_ENCRYPT                        1
  70.                                                                     /* DES operation type */
  71. #define    DES_PCBC                        0
  72. #define    DES_SCHED                        2
  73. #define    DES_ECB                            4
  74. #define    DES_QUAD_CKSUM                    6
  75.                                                                     /* getV4Ticket flags */
  76. #define    DONT_PROMPT_FLAG                0x0000
  77. #define    PROMPT_FLAG                        0x0001                            /* bit 0 set */
  78.  
  79.                                                                     /* doMsgCallback flags */
  80. #define    MSG_REGISTER                    0x0000
  81. #define    MSG_DEREGISTER                    0x0001
  82. #define    MSG_REGISTER_MENU                0x0002
  83.                                                                         
  84.                                                                     /* prototype for callback function */
  85.                                                                         /* note: always return noErr */
  86. typedef pascal OSErr
  87. (*doAuthMsgCallbackProc)(short messageID,_V4ticketInfo *,long userData);
  88.                                                                     /* callback messageIDs */
  89. #define    AUTH_MSG_V4TICKETADDED            0x0001
  90. #define    AUTH_MSG_V4TICKETEXPIRED        0x0002
  91. #define    AUTH_MSG_MENUITEM_SELECTED        0x0003
  92. #define    AUTH_RELOAD_CONFIG_INFO            0x0004
  93.  
  94.                                                                     /* AuthMan v1 prototypes  */
  95. pascal OSErr    openAuthMan(short *refNum,short *version);
  96. pascal OSErr    getDefaultRealm(short refNum,Str255 *realmName,short *realmType);
  97. pascal OSErr    getAuthenticationStatus(short refNum,short *status);
  98. pascal OSErr    getUniqname(short refNum,Str255 *uniqName);
  99. pascal OSErr    setUniqname(short refNum,Str255 *uniqName);
  100.  
  101.                                                                     /* AuthMan v2 additional prototypes  */
  102. pascal OSErr    reloadDrvrInfo(short refNum);
  103. pascal OSErr    getV4Ticket(short refNum,void *ticketStorage,short *ticketLen,    \
  104.                             Str255 *sName,Str255 *sInstance,Str255 *sRealm,        \
  105.                             long lifetimeInSecs,short flag);
  106. pascal OSErr    expireV4Ticket(short refNum,Str255 *sName,Str255 *sInstance,Str255 *sRealm);
  107. pascal OSErr    getV4TicketNinfo(short refNum,short ticketNum,_V4ticketInfo *);
  108. pascal OSErr    getRealmNinfo(short refNum,short realmNum,Str255 *realmName,    \
  109.                             short *AFSflag,short *numHosts);
  110. pascal OSErr    getRealmHostNinfo(short refNum,short realmNum,short hostNum,    \
  111.                             Str255 *hostName,short *portNum);
  112.  
  113.                                                                     /* AuthMan v3 additional prototypes  */
  114. pascal OSErr    doDES(short refNum,short operation,void *sessionKey,    \
  115.                             void *buffer,long bufferLen);
  116. pascal OSErr    setV4Password(short refNum,Str255 *pName,Str255 *pInstance,Str255 *pRealm);
  117. pascal OSErr    doMsgCallback(short refNum,short callbackOperation,        \
  118.                             doAuthMsgCallbackProc callbackRtn,long callbackMiscData,long userData);
  119.